<template>
	<view>
		<view class="page-body">
			<view class="page-section page-section-gap">
				<map style="width: 100%; height: 600px;" :latitude="latitude" :longitude="longitude" :markers="covers">
				</map>
			</view>
		</view>
	</view>
</template>


<script>
 
 export default {
 	data() {
 		return {
 			id:0, // 使用 marker点击事件 需要填写id
 			title: 'map',
 			latitude: 39.909,
 			longitude: 116.39742,
 			covers: [{
 				latitude: 39.909,
 				longitude: 116.39742,
 				iconPath: '../../../static/logo.png'
 			}, {
 				latitude: 39.90,
 				longitude: 116.39,
 				iconPath: '../../../static/logo.png'
 			}]
 		}
 	},
	onLoad() {
		// this.getUserLocation();
	},
 	methods: {
		 getUserLocation() {
			 console.log("test")
			   uni.getLocation({
				 type: 'gcj02',
				 success: (res) => {
					 console.log(res);
					 
				   this.longitude = res.longitude
				   this.latitude = res.latitude
				 },
				 fail:(res) => {
					 console.log(res);
				 }
			   })
			 }
 	}
 }

</script>

<style lang="scss">
  page {
    background-color: #ffffff;
  }
</style>
